/*
隐藏剧情配置
player 玩家队里必须出现  填主角视为玩家
army   当前场景npc必须出现
reward 奖励 type--奖励类型（addAttr--属性增加 name 属性增加人 attr 增加属性值）
talk   触发剧情对话
isdie  npc是否战死

preStory 前置剧情
storyPlace  地点剧情 player存在且地点匹配
*/
window._HSTORY = {

    //宋江剧情 '呼保义'
    "孝义黑三郎·一":{
        player:['主角'],
        army:['宋江'],
        reward:[
            {type:'addPlayer',name:'宋江'}
        ],
        talk:[
            {face:"宋江",name:"宋江",msg:"这里有五两银子,拿去使,不用还"},
        ]
    },

    "孝义黑三郎·二":{
        player:['主角','宋江'],
        army:['王英'],
        reward:[
            {type:'addPlayer',name:'王英'}
        ],
        talk:[
            {face:"宋江",name:"宋江",msg:"可惜宋江死在这里！"},
            {face:"王英",name:"王英",msg:"你莫不是山东及时雨宋公明？"},
        ],
        preStory:'孝义黑三郎·一',
    },

    "孝义黑三郎·三":{
        player:['主角','宋江'],
        army:['花荣'],
        reward:[
            {type:'addPlayer',name:'花荣'}
        ],
        talk:[
            {face:"花荣",name:"花荣",msg:"今日天赐，幸得哥哥到此，相见一面，大称平生渴仰之思。"}
        ],
        preStory:'孝义黑三郎·二',
    },

    "孝义黑三郎·四":{
        player:['主角','宋江'],
        army:['秦明'],
        reward:[
            {type:'addPlayer',name:'秦明'}
        ],
        talk:[
            {face:"秦明",name:"秦明",msg:"我是被擒之人，由你们碎尸而死，何故却来拜我？"},
            {face:"宋江",name:"宋江",msg:"小喽啰不识尊卑，误有冒渎，切乞恕罪！"}
        ],
        preStory:'孝义黑三郎·三',
    },

    "孝义黑三郎·五":{
        player:['主角','宋江'],
        army:["戴宗","李逵"],
        reward:[
            {type:'addPlayer',name:'李逵'},
            {type:'addPlayer',name:'戴宗'}
        ],
        talk:[
            {face:"李逵",name:"李逵",msg:"你这矮黑杀才！倚仗谁的势要，不送常例钱来与我？"},
            {face:"宋江",name:"宋江",msg:"人情，人情，在人情愿。你如何逼取人财，好小哉相！"},
            {face:"李逵",name:"李逵",msg:"贼配军，安敢如此无礼，颠倒说我小哉！那兜驮的，与我背起来，且打这厮一百讯棍！"},
            {face:"戴宗",name:"戴宗",msg:"住手！"},
        ],
        preStory:'孝义黑三郎·四',
    },

    "孝义黑三郎·六":{
        player:['主角','宋江',"李逵"],
        army:["张顺","张横"],
        reward:[
            {type:'addPlayer',name:'张顺'},
            {type:'addPlayer',name:'张横'},
            {type:'addSkill',name:'呼保义'}
        ],
        talk:[
            {face:"李逵",name:"李逵",msg:"等甚么鸟主人！先把两尾鱼来与我。"},
            {face:"张顺",name:"张顺",msg:"甚么黑大汉，敢如此无礼？"},
            {face:"李逵",name:"李逵",msg:"干你鸟事！"},
            {face:"宋江",name:"宋江",msg:"张二哥不要动手，有你令兄张横家书在此。"},
        ],
        preStory:'孝义黑三郎·五',
    },
	
	//萧嘉穗专属剧情
	"剑神·一":{
        player:['主角'],
        army:['萧嘉穗'],
        reward:[
            {type:'addPlayer',name:'萧嘉穗'}
        ],
        talk:[
            {face:"萧嘉穗",name:"萧嘉穗",msg:"你...可会使剑？"},
        ]
    },
	
	"剑神·二":{
        player:['主角','萧嘉穗'],
        army:['玄武'],
        reward:[
            {type:'addAttr',name:'萧嘉穗',attr:{'plv':-50}}
        ],
        talk:[
            {face:"萧嘉穗",name:"萧嘉穗",msg:"剑术的巅峰吗...到底是什么呢"},
			{face:"玄武",name:"玄武",msg:"小子,就让我来试试你有几斤几量！"},
        ],
		storyPlace:'梁山泊',
		preStory:'剑神·一',
    },
	
	"剑神·三":{
        player:['主角','萧嘉穗'],
        army:['青龙'],
        reward:[
            {type:'addAttr',name:'萧嘉穗',attr:{'dlv':-50}}
        ],
        talk:[
            {face:"萧嘉穗",name:"萧嘉穗",msg:"上次那乌龟好不厉害,一条胳膊就此废了,这条路不知道还能走多远..."},
			{face:"青龙",name:"青龙",msg:"想要退缩吗？你还差的远呢！"},
        ],
		storyPlace:'盖州',
		preStory:'剑神·二',
    },
	
	"剑神·四":{
        player:['主角','萧嘉穗'],
        army:['白虎'],
        reward:[
            {type:'addAttr',name:'萧嘉穗',attr:{'mlv':-50}}
        ],
        talk:[
            {face:"萧嘉穗",name:"萧嘉穗",msg:"...我已经看不见了啊,剑道到底还要夺取我多少..."},
			{face:"白虎",name:"白虎",msg:"记住,要用心眼去看！"},
        ],
		storyPlace:'河南府',
		preStory:'剑神·三',
    },
	
	"剑神·五":{
        player:['主角','萧嘉穗'],
        army:['朱雀'], 
        reward:[
            {type:'addAttr',name:'萧嘉穗',attr:{'hlv':-50}}
        ],
        talk:[
            {face:"萧嘉穗",name:"萧嘉穗",msg:"...好热...真是可笑,我这副身躯居然还能感受到温度..."},
			{face:"朱雀",name:"朱雀",msg:"死心吧,凡人！"},
        ],
		storyPlace:'杭州',
		preStory:'剑神·四',
    },
	
	"剑神·六":{
        player:['主角','萧嘉穗'],
        army:['银猿'],
        reward:[
            {type:'addAttr',name:'萧嘉穗',attr:{'ilv':-50}},
			{type:'addSkill',name:'真·剑神'},
			{type:'addSkill',name:'唐诗剑法'}
        ],
        talk:[
            {face:"萧嘉穗",name:"萧嘉穗",msg:"......"},
			{face:"银猿",name:"银猿",msg:"这是最后一战了,你这废人还撑的住吗..."},
			{face:"萧嘉穗",name:"萧嘉穗",msg:"......"},
			{face:"银猿",name:"银猿",msg:"原来如此,看不见也听不见,居然还能用剑,来吧就让我来终结你"},
        ],
		storyPlace:'开封府',
		preStory:'剑神·五',
    },
	//结束
	

    "风雪山神庙":{
        player:['林冲'],
        army:['富安','陆谦'],
        reward:[
            {type:'addAttr',name:'林冲',attr:{'plv':10}}
        ],
        talk:[
            {face:"林冲",name:"林冲",msg:"陆谦! 我与你自幼相交，今日倒来害我"},
            {face:"陆谦",name:"陆谦",msg:"不干小人事;太尉差遣，不敢不来。"}
        ],
        isdie:1
    },


    "景阳岗打虎":{
        player:['武松'],
        army:['吊睛白额虎'],
        reward:[
            {type:'addAttr',name:'武松',attr:{'plv':5}}
        ],
        talk:[
            {face:"虎",name:"吊睛白额虎",msg:"吼！"},
            {face:"武松",name:"武松",msg:"！"},
        ],
		storyPlace:'景阳冈'
    },	

	
    "醉打蒋门神":{
        player:['武松'],
        army:['蒋忠'],
        reward:[
            {type:'addAttr',name:'武松',attr:{'plv':5}}
        ],
        talk:[
            {face:"武松",name:"武松",msg:"那妇人下来，相伴我吃酒。"},
            {face:"蒋忠",name:"蒋忠",msg:"这里也是你能撒野的地方！"},
        ],
        isdie:1
    },
	
    "除恶蜈蚣岭":{
        player:['武松'],
        army:['王道人'],
        reward:[
            {type:'addAttr',name:'武松',attr:{'plv':5}}
        ],
        talk:[
            {face:"王道人",name:"王道人",msg:"谁敢杀我道童！"},
            {face:"武松",name:"武松",msg:"我的本事，不要箱儿里去取，正是挠着我的痒处。"},
        ],
        isdie:1
    },	
	
	"战神武大郎":{
        player:['武大郎','乔郓哥'],
        army:['西门庆','潘金莲','王婆'],
        reward:[
            {type:'addAttr',name:'武大郎',attr:{'dlv':50,'mlv':50,'hlv':50}},
            {type:'addAttr',name:'乔郓哥',attr:{'plv':50,'dlv':50,'hlv':50}},
            {type:'addSkill',name:'饼梨套餐'},			
        ],
        talk:[
            {face:"乔郓哥",name:"乔郓哥",msg:"我来缠住那婆子，你先冲进去"},
            {face:"武大郎",name:"武大郎",msg:"我省得，你速来帮我"},
            {face:"武大郎",name:"武大郎",msg:"奸夫淫妇，我知道你们在里面，快开门"},
			{face:"西门庆",name:"西门庆",msg:"这。。如何是好"},
            {face:"潘金莲",name:"潘金莲",msg:"没用的东西，快活时逞尽威风，一遇事只知道躲躲藏藏"},
            {face:"西门庆",name:"西门庆",msg:"娘子休怪，惊慌之下一时失了主意，我这就去教训他"},
        ],
        isdie:1
    },	

	
	 "鸩杀武大郎":{
        player:['潘金莲','王婆'],
        army:['武大郎'],
        reward:[
            {type:'addAttr',name:'潘金莲',attr:{'dlv':50,'hlv':50}},
            {type:'addAttr',name:'王婆',attr:{'ilv':50}},
            {type:'addSkill',name:'蛇蝎心肠'},
            {type:'addSkill',name:'诸葛再世'},			
        ],
        talk:[
            {face:"潘金莲",name:"潘金莲",msg:"大郎，该喝药了"},
            {face:"武大郎",name:"武大郎",msg:"若医好了我，你与西门庆那事，必不与我那兄弟知道"},
            {face:"武大郎",name:"武大郎",msg:"咳咳咳。。。药里。。。你！！！"},
            {face:"潘金莲",name:"潘金莲",msg:"干娘，干娘！怎么办？"},
            {face:"王婆",name:"王婆",msg:"这么大人了没点主意，还要老娘亲自出马"},
        ],
        isdie:1
    },
	
    "斗杀西门庆":{
        player:['武松'],
        army:['西门庆','潘金莲','王婆'],
        reward:[
            {type:'addAttr',name:'武松',attr:{'plv':10}}
        ],
        talk:[
            {face:"武松",name:"武松",msg:"奸贼,还我哥哥命来！"},
            {face:"西门庆",name:"西门庆",msg:"不好,快跑!"},
        ],
        isdie:1,
		preStory:'鸩杀武大郎',
    },	
		
	
    "拳打镇关西":{
        player:['鲁智深'],
        army:['郑屠'],
        reward:[
            {type:'addAttr',name:'鲁智深',attr:{'plv':5}}
        ],
        talk:[
            {face:"鲁智深",name:"鲁智深",msg:"奉着经略相公钧旨：要十斤精肉，切作臊子，不要见半点肥的在上面。"},
            {face:"郑屠",name:"郑屠",msg:"提辖，叫人送去？"},
            {face:"鲁智深",name:"鲁智深",msg:"送甚么！且住，再要十斤都是肥的，不要见些精的在上面，也要切做臊子。"},
            {face:"郑屠",name:"郑屠",msg:"着人与提辖拿了，送将府里去？"},
            {face:"鲁智深",name:"鲁智深",msg:"再要十斤寸金软骨，也要细细地剁做臊子，不要见些肉在上面。"},
            {face:"郑屠",name:"郑屠",msg:"却不是特地来消遣我？"},
            {face:"鲁智深",name:"鲁智深",msg:"洒家特地要消遣你！"},			
        ],
        isdie:1
    },
	
	
	"火烧瓦罐寺":{
        player:['鲁智深'],
        army:['崔道成','丘小乙'],
        reward:[
            {type:'addAttr',name:'鲁智深',attr:{'plv':10}}
        ],
        talk:[
            {face:"鲁智深",name:"鲁智深",msg:"你这厮们，来，来!今番和你斗个你死我活！"},
            {face:"崔道成",name:"崔道成",msg:"你是我手里败将，如何再来敢厮并？"},
            {face:"丘小乙",name:"丘小乙",msg:"自寻死路！"},
        ],
        isdie:1
    },
	
	"智取二龙山":{
        player:['鲁智深'],
        army:['邓龙'],
        reward:[
            {type:'addAttr',name:'鲁智深',attr:{'plv':5}}
        ],
        talk:[
            {face:"邓龙",name:"邓龙",msg:"你那厮秃驴！前日点翻了我，伤了小腹，至今青肿未消，今日也有见我的时节！"},
            {face:"鲁智深",name:"鲁智深",msg:"撮鸟休走！"},
        ],
        isdie:1
    },
	
	"汴京城卖刀":{
        player:['杨志'],
        army:['牛二'],
        reward:[
            {type:'addAttr',name:'杨志',attr:{'plv':10}}
        ],
        talk:[
            {face:"杨志",name:"杨志",msg:"你那厮秃驴！前日点翻了我，伤了小腹，至今青肿未消，今日也有见我的时节！"},
            {face:"牛二",name:"牛二",msg:"怎么杀人刀上没血？"},
            {face:"杨志",name:"杨志",msg:"把人一刀砍了，并无血痕，只是个快。"},
            {face:"牛二",name:"牛二",msg:"我不信，你把刀来剁一个人我看。"},
            {face:"杨志",name:"杨志",msg:"禁城之中，如何敢杀人？你不信时，取一只狗来杀与你看。"},
            {face:"牛二",name:"牛二",msg:"你说杀人，不曾说杀狗！"},
            {face:"杨志",name:"杨志",msg:"你不买便罢，只管缠人做甚么？"},
            {face:"牛二",name:"牛二",msg:"你敢杀我？"},
        ],
        isdie:1
    },	
	
	"怒杀阎婆惜":{
        player:['宋江'],
        army:['阎婆惜'],
        reward:[
            {type:'addAttr',name:'宋江',attr:{'hlv':10}}
        ],
        talk:[
            {face:"宋江",name:"宋江",msg:"你真个不还？"},
            {face:"阎婆惜",name:"阎婆惜",msg:"不还！再饶你一百个不还！若要还时，在郓城县还你！"},
        ],
        isdie:1
    },
	
	"血溅翠屏山":{
        player:['杨雄','石秀'],
        army:['潘巧云','裴如海'],
        reward:[
            {type:'addAttr',name:'杨雄',attr:{'plv':10}},
            {type:'addAttr',name:'石秀',attr:{'plv':10}}			
        ],
        talk:[
			{face:"石秀",name:"石秀",msg:"淫邪秃驴，看刀"},			
			{face:"裴如海",name:"裴如海",msg:"英雄切莫动粗"},            
			{face:"杨雄",name:"杨雄",msg:"今日你还有何话说"},
            {face:"潘巧云",name:"潘巧云",msg:"枉你杨雄自视英雄，却不懂儿女之情。我跟了你两年，还没与师兄一夜快活"},
			{face:"石秀",name:"石秀",msg:"大哥，还留她作甚"},
			{face:"杨雄",name:"杨雄",msg:"贱人找死"},			
        ],
        isdie:1
    },	

	"踏平曾头市":{
        player:['卢俊义'],
        army:['曾弄','史文恭','曾涂','曾魁','曾升'],
        reward:[
            {type:'addAttr',name:'卢俊义',attr:{'plv':20,'hlv':10}}
        ],
        talk:[
			{face:"卢俊义",name:"卢俊义",msg:"强贼待走哪里去！"},
            {face:"曾弄",name:"曾弄",msg:"唉，我曾头市当初就不该去招惹这群强人"},
            {face:"曾涂",name:"曾涂",msg:"爹爹，事已至此，唯有死战"},
            {face:"曾魁",name:"曾魁",msg:"大哥说的是"},
            {face:"曾升",name:"曾升",msg:"尽管来，咱也不怕他"},
            {face:"史文恭",name:"史文恭",msg:"人说河北玉麒麟，枪棒天下无对，史某今日讨教一二"},
            {face:"卢俊义",name:"卢俊义",msg:"你们五个一起上，我卢某人何惧？"},			
        ],
        isdie:1
    },

	
	
/*	"杨雄怒杀妻":{
        player:['杨雄'],
        army:['潘巧云','裴如海'],
        reward:[
            {type:'addAttr',name:'宋江',attr:{'plv':5}}
        ],
        talk:[
            {face:"杨雄",name:"杨雄",msg:""},
            {face:"潘巧云",name:"潘巧云",msg:""},
        ],
        isdie:1
    },	
*/

	"夜战没羽箭":{
        player:['厉天闰'],
        army:['张清'],
        reward:[
            {type:'addAttr',name:'厉天闰',attr:{'plv':10}}
        ],
        talk:[
            {face:"厉天闰",name:"厉天闰",msg:"白日未曾取你性命，夜间还来送死？"},
            {face:"张清",name:"张清",msg:"休要猖狂"},
        ],
        isdie:1
    },

	"力斩插翅虎":{
        player:['司行方'],
        army:['雷横'],
        reward:[
            {type:'addAttr',name:'司行方',attr:{'plv':10}}
        ],
        talk:[
            {face:"雷横",name:"雷横",msg:"谁敢应战？"},
            {face:"司行方",name:"司行方",msg:"哼！无名小卒也敢叫阵"},
        ],
        isdie:1
    },	

	"箭射少华山":{
        player:['庞万春'],
        army:['史进','陈达','杨春'],
        reward:[
            {type:'addAttr',name:'庞万春',attr:{'plv':15}}
        ],
        talk:[
            {face:"庞万春",name:"庞万春",msg:"万箭齐发！"},
            {face:"史进",name:"史进",msg:"..."},
            {face:"陈达",name:"陈达",msg:"..."},
            {face:"杨春",name:"杨春",msg:"..."},
        ],
        isdie:1
    },
	
	"锤打急先锋":{
        player:['石宝'],
        army:['索超'],
        reward:[
            {type:'addAttr',name:'石宝',attr:{'plv':10}}
        ],
        talk:[
            {face:"石宝",name:"石宝",msg:"着！"},
            {face:"索超",name:"索超",msg:"！"},
        ],
        isdie:1
    },	
	
	"计杀水火将":{
        player:['王寅'],
        army:['单廷珪','魏定国'],
        reward:[
            {type:'addAttr',name:'王寅',attr:{'plv':10}}
        ],
        talk:[
            {face:"单廷珪",name:"单廷珪",msg:"这头功我要定了"},
            {face:"魏定国",name:"魏定国",msg:"那可未必，走着瞧"},
            {face:"王寅",name:"王寅",msg:"哈哈哈，还有人抢着送死吗"},
        ],
        isdie:1
    },	
	
	"阵斩霹雳火":{
        player:['方杰'],
        army:['秦明'],
        reward:[
            {type:'addAttr',name:'方杰',attr:{'plv':10}}
        ],
        talk:[
            {face:"秦明",name:"秦明",msg:"看我斩此来将"},
            {face:"方杰",name:"方杰",msg:"哼！"},
        ],
        isdie:1
    },
    
    '浪子燕青':{
        player:['燕青'],
        army:['李师师'],
        reward:[
            {type:'addPlayer',name:'李师师'},
            {type:'addSkill',name:'浪子'}
        ],
        talk:[
            {face:"燕青",name:"燕青",msg:"小人是个该死的人，如何敢对花魁娘子坐地？"},
            {face:"李师师",name:"李师师",msg:"休恁地说！你这一般义士，久闻大名。只是奈缘中间无有好人与你们众位作成，因此上屈沉水泊。"},
        ]
    },

    '义结金兰':{
        player:['林冲'],
        army:['鲁智深'],
        reward:[
            {type:'addPlayer',name:'鲁智深'}
        ],
        talk:[
            {face:"林冲",name:"林冲",msg:"这个师父端的非凡，使的好器械！"},
            {face:"鲁智深",name:"鲁智深",msg:"何不就请来厮见？"},
        ]
    },

    '火并王伦':{
        player:['林冲','吴用'],
        army:['王伦'],
        reward:[
            {type:'addAttr',name:'吴用',attr:{'ilv':10}},
            {type:'addAttr',name:'林冲',attr:{'plv':10}},
            {type:'addSkill',name:'节奏大师'},
            {type:'beMaster',name:'东王'},
        ],
        talk:[
            {face:"林冲",name:"林冲",msg:"王伦！量你是个落第腐儒，胸中又没文学，怎做得山寨之主！"},
            {face:"王伦",name:"王伦",msg:"你看这畜生！又不醉了，倒把言语来伤触我，却不是反失上下！"},
            {face:"吴用",name:"吴用",msg:"千万不要火并啊！"},
        ],
        isdie:1,
        noCountry:1
    },


    //二周目剧情
    '浔阳楼遭遇战':{
        army:['皇副'],
        reward:[
            {type:'addSkill',name:'穿梭'}
        ],
        talk:[
            {face:"皇副",name:"？？？",msg:"想知道大秘宝的情报吗？"}
        ],
        second:1,//二周目标识
        storyPlace:'浔阳楼'
    },

    '塞北之战·一':{
        army:['兀颜光','兀颜延寿','国永泰','萧大观','成珠那海'],
        reward:[],
        talk:[
            {face:"皇副",name:"兀颜光",msg:"我不知道什么大秘宝"}
        ],
        second:1,//二周目标识
        storyPlace:'塞北',
        preStory:'浔阳楼遭遇战',
    },

    '塞北之战·二':{
        army:['郭永昌','李复','张起','童里合','雷春'],
        reward:[],
        talk:[
            {face:"皇副",name:"郭永昌",msg:"得罪了我们老大还想活着出去？"}
        ],
        second:1,//二周目标识
        storyPlace:'幽州',
        preStory:'塞北之战·一',
    },

    '塞北之战·三':{
        army:['宝密圣','天山勇','耶律得重','答里孛','只儿拂郎'],
        reward:[],
        talk:[
            {face:"皇副",name:"宝密圣",msg:"得罪了我们老大还想活着出去？"}
        ],
        second:1,//二周目标识
        storyPlace:'辽国',
        preStory:'塞北之战·二',
    },

    '塞北之战·四':{
        army:['褚坚','洞仙文荣','曲利出清','乌利可安','贾茂'],
        reward:[],
        talk:[
            {face:"皇副",name:"褚坚",msg:"得罪了我们老大还想活着出去？"}
        ],
        second:1,//二周目标识
        storyPlace:'辽国',
        preStory:'塞北之战·三',
    },

    '塞北之战·五':{
        army:['兀颜光','兀颜延寿','阿里奇','琼妖纳延','贺重宝'],
        reward:[
            {type:'addSkill',name:'超·玉麒麟'}
        ],
        talk:[
            {face:"皇副",name:"兀颜光",msg:"再打一场我就告诉你大秘宝在哪"}
        ],
        second:1,//二周目标识
        storyPlace:'辽国',
        preStory:'塞北之战·四',
    },

    '皇陵之战·一':{
        army:['赵匡胤','赵光义','赵普','寇準','杨业'],
        reward:[],
        talk:[
            {face:"皇副",name:"赵匡胤",msg:"去死吧可恶的盗墓贼"}
        ],
        second:1,//二周目标识
        storyPlace:'大宋皇陵',
        preStory:'塞北之战·五',
    },

    '皇陵之战·二':{
        army:['赵匡胤','狄青','高怀德','呼延赞','石守信'],
        reward:[],
        talk:[
            {face:"皇副",name:"赵匡胤",msg:"去死吧可恶的盗墓贼"}
        ],
        second:1,//二周目标识
        storyPlace:'大宋皇陵',
        preStory:'皇陵之战·一',
    },

    '皇陵之战·三':{
        player:['主角'],
        army:['赵匡胤'],
        reward:[
            {type:'addSkill',name:'忠义无双'}
        ],
        talk:[
            {face:"皇副",name:"赵匡胤",msg:"有种单挑啊"}
        ],
        second:1,//二周目标识
        storyPlace:'大宋皇陵',
        preStory:'皇陵之战·二',
    },

    '台湾之战·一':{
        army:['钮盖忒','马尔糕','艾思','乔仔','比斯挞'],
        reward:[],
        talk:[
            {face:"皇副",name:"钮盖忒",msg:"我就是海上皇帝钮盖忒"}
        ],
        second:1,//二周目标识
        storyPlace:'台湾城',
        preStory:'皇陵之战·三',
    },

    '台湾之战·二':{
        player:['主角'],
        army:['艾思'],
        reward:[
            {type:'addSkill',name:'替天行道'}
        ],
        talk:[
            {face:"皇副",name:"艾思",msg:"打赢了我你才有资格挑战我爸"}
        ],
        second:1,//二周目标识
        storyPlace:'台湾城',
        preStory:'台湾之战·一',
    },

    '倭之战·一':{
        army:['罗捷','雷力','贾霸','御甜','犬蓝'],
        reward:[],
        talk:[
            {face:"皇副",name:"罗捷",msg:"就是你小子打赢了白胡子？"}
        ],
        second:1,//二周目标识
        storyPlace:'倭城',
        preStory:'台湾之战·二',
    },

    '倭之战·二':{
        player:['主角'],
        army:['罗捷'],
        reward:[
            {type:'addSkill',name:'避火'},
            {type:'addSkill',name:'混沌'}
        ],
        talk:[
            {face:"皇副",name:"罗捷",msg:"有胆子和我单挑吗？"}
        ],
        second:1,//二周目标识
        storyPlace:'倭城',
        preStory:'倭之战·一',
    },

    '最终之战·一':{
        army:['山贼王'],
        reward:[],
        talk:[
            {face:"皇副",name:"？？？",msg:"打赢了我你就是山贼王了"}
        ],
        second:1,//二周目标识
        storyPlace:'乾坤塔',
        preStory:'倭之战·二',
    },

    '最终之战·二':{
        army:['九天玄女'],
        reward:[],
        talk:[
            {face:"皇副",name:"九天玄女",msg:"没错,我就是那个大秘宝"}
        ],
        second:1,//二周目标识
        storyPlace:'乾坤塔',
        preStory:'最终之战·一',
    },
    
    //彩蛋剧情
    'ATM保安之战':{
        army:['隔壁老王','猪先生','嫩牛五方','我睡了','早啊'],
        reward:[{type:'addSkill',name:'V我50'}],
        talk:[
            {face:"隔壁老王",name:"隔壁老王",msg:"想打ATM先过我这关"},
            {face:"猪先生",name:"猪先生",msg:"俺也一样"},
            {face:"嫩牛五方",name:"嫩牛五方",msg:"俺也一样"},
            {face:"我睡了",name:"我睡了",msg:"俺也一样"},
            {face:"早啊",name:"早啊",msg:"俺也一样"}
        ],
        second:1,//二周目标识
        storyPlace:'赚大钱工作室'
    },
    'ATM之战':{
        army:['ATM'],
        reward:[
            {type:'addSkill',name:'变鸡术'},
            {type:'addSkill',name:'大魔王之证'}
        ],
        talk:[
            {face:"atm",name:"ATM",msg:"来打我啊"}
        ],
        second:1,//二周目标识
        storyPlace:'赚大钱工作室',
        preStory:'ATM保安之战',
    },
    
    
    //史实剧情
    //第一章 威震三山
    "知府有令":{
        player:['黄信'],
        army:['慕容彦达'],
        reward:[],
        talk:[
            {face:"慕容彦达",name:"慕容彦达",msg:"黄都监来的正好，今三山贼寇猖獗，本知府欲出兵剿之"},
            {face:"黄信",name:"黄信",msg:"区区毛贼，无须大人亲自出马，属下可代劳"},
            {face:"慕容彦达",name:"慕容彦达",msg:"如此甚好，你师傅久经战场，出发前先听听你师傅的意思"},
            {face:"黄信",name:"黄信",msg:"是，属下告辞"},
        ],
        his:1,//史实标志
    },
    
    "师傅之意":{
        player:['黄信'],
        army:['秦明'],
        reward:[],
        talk:[
            {face:"黄信",name:"黄信",msg:"师傅，徒弟奉知府大人之命，即将前往剿灭三山贼寇，临行前听听师父的教诲"},
            {face:"秦明",name:"秦明",msg:"如此甚好，既然大家叫你镇三山，需当得起此名。不过三山贼寇势大，你仍需寻找帮手"},
            {face:"黄信",name:"黄信",msg:"哦？请师父教我"},            
            {face:"秦明",name:"秦明",msg:"青州城内有一酒家老板，姓曹名正，人送外号“操刀鬼”，此人乃林冲之徒，颇有能耐，你可前去招募他"},
            {face:"黄信",name:"黄信",msg:"多谢师父指点，徒弟这就前往"},
        ],
        his:1,//史实标志
        preStory:'知府有令',   
    },

    "市井屠夫":{
        player:['黄信'],
        army:['曹正'],
        reward:[
            {type:'addPlayer',name:'曹正'}
        ],
        talk:[
            {face:"曹正",name:"曹正",msg:"黄都监，何事劳您大驾，亲来小民家中？"},
            {face:"黄信",name:"黄信",msg:"某素闻此间有一好汉，人送外号“操刀鬼”，乃东京八十万禁军教头林冲高徒，今日幸会幸会！"},
            {face:"曹正",name:"曹正",msg:"都监说笑了，小人仅一市井屠户，当年在开封府有幸得师傅指点学得一些皮毛，当不得好汉。"},
            {face:"黄信",name:"黄信",msg:"闲弟休要谦虚，某正欲出兵扫平三山贼寇，今特来相邀，与闲弟共建功业。"},
            {face:"曹正",name:"曹正",msg:"多谢都监看得起在下，小民愿共同前往，就算马革裹尸，也好过在此虚度一生。"},
        ],
        his:1,//史实标志
        preStory:'师傅之意',
    },
    
    "轻取白虎山":{
        player:['黄信','曹正'],
        army:['孔明','孔亮'],
        reward:[
            {type:'addAttr',name:'黄信',attr:{'plv':5}},
            {type:'addAttr',name:'曹正',attr:{'plv':5}},
        ],
        talk:[
            {face:"孔明",name:"孔明",msg:"无胆鼠辈，今日竟敢犯我山寨？"},
            {face:"孔亮",name:"孔亮",msg:"大哥你还不了解他们？只一交战，不消片刻，这些官兵就会吓的屁滚尿流，作鸟兽散。"},
            {face:"黄信",name:"黄信",msg:"大胆草寇，今日就是你的死期！"},
            {face:"曹正",name:"曹正",msg:"这是我的第一战，一定要好好表现"},
        ],
        his:1,//史实标志
        preStory:'市井屠夫',
    }, 

    "独斗二龙山":{
        player:['黄信'],
        army:['邓龙'],
        reward:[
            {type:'addAttr',name:'黄信',attr:{'hlv':10}},
        ],
        talk:[
            {face:"邓龙",name:"邓龙",msg:"我二龙山岂容你撒野？看招！"},
            {face:"黄信",name:"黄信",msg:"哼，不自量力"},
        ],
        his:1,//史实标志
        preStory:'轻取白虎山',
    },    
    "血战清风山":{
        player:['黄信','曹正'],
        army:['燕顺','王英','郑天寿'],
        reward:[
            {type:'addAttr',name:'黄信',attr:{'plv':5}},
            {type:'addAttr',name:'曹正',attr:{'plv':5}},
            {type:'addSkill',name:'连刺'},
        ],
        talk:[
            {face:"黄信",name:"黄信",msg:"某听闻那清风山强人吃人剜心，奸淫掳掠，无恶不作，一会交战闲弟可要小心"},
            {face:"曹正",name:"曹正",msg:"小弟省得"},
            {face:"燕顺",name:"燕顺",msg:"哟！这不是黄都监吗？怎么今日有空光临小寨"},
						{face:"王英",name:"王英",msg:"大哥跟他废什么话，赶紧杀了这鸟都监，我好赶回去跟那刚抢的婆娘爽爽"},
						{face:"郑天寿",name:"郑天寿",msg:"二哥，小弟听手下喽啰说，这婆娘乃清风寨知寨刘高之妻"},
						{face:"王英",name:"王英",msg:"哦？怪不得这么水灵，刚好可以作压寨夫人"},						
						{face:"黄信",name:"黄信",msg:"猖狂之徒，今日教你们领会我镇三山的厉害！"},						
        ],
        his:1,//史实标志
        preStory:'独斗二龙山',   
    },
    
    "挑战霹雳火":{
        player:['黄信'],
        army:['秦明'],
        reward:[],
        talk:[
            {face:"秦明",name:"秦明",msg:"好！好！好！，如今荡平三山，你也算当得起“镇三山”这三个字，经过此番历练，让为师再看看你的本事"},
            {face:"黄信",name:"黄信",msg:"多谢师傅平日的悉心教导，才有徒弟的今天"},					
        ],
        his:1,//史实标志
        preStory:'血战清风山',   
    },    

    "镇三山之名":{
        player:['黄信'],
        army:['慕容彦达'],
        reward:[],
        talk:[
            {face:"黄信",name:"黄信",msg:"大人，属下征剿三山贼寇已毕，特来复命"},
            {face:"慕容彦达",name:"慕容彦达",msg:"好！此乃大功一件，我这就修书一封报往枢密院。我听小校说，今日你在切磋中赢了你师父"},	
            {face:"黄信",name:"黄信",msg:"那是我师父放水让我，他的本事，大人您也知道"},
            {face:"慕容彦达",name:"慕容彦达",msg:"黄都监过谦了，如今你威镇三山，可独挡一面了"},	
						{face:"atm",name:"atm",msg:"恭喜过关，本章完"},	                     				
        ],
        his:1,//史实标志
        preStory:'挑战霹雳火',   
    },       
}

window._HSTORYHELPER = {

    getAllIntro:function(){

        var result="";
        var index =1; 
        for(var key in _HSTORY){
            if(_HSTORYHELPER.introStory(key)){
                result+="\n"+index+"."+_HSTORYHELPER.introStory(key);
                index++;
            }
        }

        return result;

    },

    introStory:function(key){

        var conf = _HSTORY[key];

        if(!window.gameData.realPos[_HSTORY[key].army[0]]){
            return null;
        }

        var result = "名称:"+key+"\n";
        result+="我军:"+_HSTORY[key].player.join(',')+"\n";
        result+="敌军:"+_HSTORY[key].army.join(',')+(conf.isdie?'战死':'')+"\n";
        result+="地点:"+window.gameData.realPos[_HSTORY[key].army[0]].city+"\n";
        result+="奖励:";
        for(var i=0;i<conf.reward.length;i++){
            if(conf.reward[i].type=="addAttr"){
                result+="\n"+conf.reward[i].name+" 能力上升";
            }else if(conf.reward[i].type=="addSkill"){
                result+="\n获得技能:"+conf.reward[i].name;
            }else if(conf.reward[i].type=="addPlayer"){
                result+="\n获得伙伴:"+conf.reward[i].name;
            }
        }
        return result;
    },

    isNpcInArr:function(arr,npc){
		
		if(npc=="主角"){
			return true;
		}

        for(var i=0;i<arr.length;i++){
            if(arr[i].name==npc||arr[i].npc==npc){
                return true;
            }
        }

        return false;
    },

    createHideStoryTalk:function(storyname){
        return {
            talk:_HSTORY[storyname].talk,
            talkType:'hideStory',
            story:storyname
        };
    },

    createHideStoryFight:function(storyname){

        console.log('创建剧情战斗：'+storyname);
        _FIGHTPREPARE.initHideFight(storyname);
    },

    getHideStory:function(){

        var currentNpc = _MAP.getNpcArrInMap();
        var playerArr = window.gameData.playerTeam;

        for(var key in _HSTORY){
			
			if(!_GAMEDATAHELPER.isLogStory(key)){//过滤已经触发的剧情
			
				if(
					!_HSTORY[key].preStory
					||_GAMEDATAHELPER.isLogStory(_HSTORY[key].preStory)
				){//判断是否有前置剧情

					var noCountry = _HSTORY[key].noCountry;
					var storyPlace = _HSTORY[key].storyPlace;
                    var second = _HSTORY[key].second;

					if(
						(!noCountry||!window.gameData.country)
                        &&(!second||_GAMEDATAHELPER.isSecondPart())
					){//过滤未加入势力条件
					
						if(!storyPlace){//非定点触发条件
							var playerMap = _HSTORY[key].player;
							var armyMap = _HSTORY[key].army;
							var allNpc = true;
							var allPlayer = true;
							for(var i=0;i<playerMap.length;i++){
								if(!_HSTORYHELPER.isNpcInArr(playerArr,playerMap[i])){
									allPlayer=false;
									break;
								}
							}

							if(allPlayer){
								for(var i=0;i<armyMap.length;i++){  
									if(!_HSTORYHELPER.isNpcInArr(currentNpc,armyMap[i])){
										allNpc=false;
										break;
									}
								}

								if(allNpc){
									return _HSTORYHELPER.createHideStoryTalk(key);
								}
							}
						}else if(storyPlace&&window.gameData.defaultMap==storyPlace){//定点触发条件
						
							var playerMap = _HSTORY[key].player;
							var allPlayer = true;

                            if(playerMap){
                                for(var i=0;i<playerMap.length;i++){
                                    if(!_HSTORYHELPER.isNpcInArr(playerArr,playerMap[i])){
                                        allPlayer=false;
                                        break;
                                    }
                                }
                            }
						
							if(allPlayer){
								return _HSTORYHELPER.createHideStoryTalk(key);
							}
						}
					}
				}
			}
        }

        return null;
    }

}